<template>
  <div class="page">
    <div class="header">
      <div class="iconfont hico" @click="$router.back()">&#xe603;</div>
      <div class="title">我的</div>
      <!-- 小U商城 -->
      <!-- <div class="hr"> -->
      <van-button type="danger" class="hr" @click="logout" v-if="islogin">退出</van-button>
      <van-button type="danger" class="hr" v-else @click="logins">登录</van-button>
      <!-- </div> -->
    </div>
    <div class="nav">
      <div class="logo">
        <div class="imgs"></div>
        <div class="uname">
          <div class="uname1">代用名</div>
          <div class="uname2">完善资料让小U更懂您</div>
        </div>
        <div class="qd">
          <svg class="icon" aria-hidden="true">
            <use xlink:href="#icon-hongbao"></use>
          </svg>
          每日签到
        </div>
      </div>
      <div class="hot">
        <ul>
          <li>
            <span>12</span>
            <p>我的收藏</p>
          </li>
          <li>
            <span>12</span>
            <p>浏览记录</p>
          </li>
          <li>
            <span>&yen;12</span>
            <p>我的红包</p>
          </li>
          <li>
            <span>12</span>
            <p>优惠券</p>
          </li>
        </ul>
      </div>
      <div class="order">
        <div class="top">
          <div class="t1">我的订单</div>
          <div class="t2">
            全部订单<span class="iconfont icon2">&#xe62b;</span>
          </div>
        </div>
        <div class="btm">
          <ul>
            <li>
              <div class="imgss">
                <img
                  src="../../assets/img/icon/user/order/payment.png"
                  alt=""
                />
              </div>
              <p>待付款</p>
            </li>
            <li>
              <div class="imgss">
                <img
                  src="../../assets/img/icon/user/order/delivery.png"
                  alt=""
                />
              </div>
              <p>待收货</p>
            </li>
            <li>
              <div class="imgss">
                <img
                  src="../../assets/img/icon/user/order/evaluation.png"
                  alt=""
                />
              </div>
              <p>评价</p>
            </li>
            <li>
              <div class="imgss">
                <img
                  src="../../assets/img/icon/user/order/service.png"
                  alt=""
                />
              </div>
              <p>售后/退款</p>
            </li>
          </ul>
        </div>
      </div>
    </div>
    <div class="main">
      <ul>
        <li>
          <p>地址管理</p>
          <p class="iconfont">&#xe62b;</p>
        </li>
        <li>
          <p>我的钱包</p>
          <p class="iconfont">剩余200U币&#xe62b;</p>
        </li>
        <li>
          <p>我的二维码</p>
          <p class="iconfont">&#xe62b;</p>
        </li>
        <li>
          <p>我的小伙伴</p>
          <p class="iconfont">&#xe62b;</p>
        </li>
        <li>
          <p>0元试用</p>
          <p class="iconfont">&#xe62b;</p>
        </li>
      </ul>
    </div>

    <v-nav></v-nav>
  </div>
</template>

<script>
import "../../assets/css/font/iconfont";
import vNav from "../vNav";
import { Dialog } from "vant";
export default {
  components: {
    vNav,
  },
  data(){
    return{
      islogin:false
    }
  },
  methods: {
    logout() {
      if (sessionStorage.getItem("userInfo")) {
        Dialog.confirm({
          title: "确定要退出吗？",
          message: "再玩会啊",
        })
          .then(() => {
            this.islogin = false;
            sessionStorage.setItem("userInfo", "");
            this.$router.replace("/login");
          })
          .catch(() => {});
      }
    },
    logins(){
       this.islogin=true;
       this.$router.push("/login")
    },
    
  },
  mounted(){
    if(sessionStorage.getItem("userInfo")){
      this.islogin = true
    }
  }
};
</script>

<style scoped>
.icon {
  width: 1em;
  height: 1em;
  vertical-align: -0.15em;
  fill: currentColor;
  overflow: hidden;
  /* font-size: 0.24rem; */
}
.page {
  min-width: 3.75rem;
  width: 7.5rem;
  height: 100vh;
  margin: 0 auto;
  position: relative;
  background-color: rgb(242, 242, 242);
}
.header {
  width: 7.5rem;
  height: 0.88rem;
  line-height: 0.88rem;
  background-color: #ff6040;
  display: flex;
  color: #fff;
  align-items: center;
  position: relative;
  /* text-align: center; */
  /* padding: 0 0.1rem; */
}
.hico {
  font-size: 0.45rem;
  /* margin-left: 0.2rem; */
  /* flex: 1; */
  /* text-align: left; */
  position: absolute;
  left: 0.2rem;
}
.header .title {
  /* color: */
  font-size: 0.34rem;
  flex: 1;
  /* margin: 0 auto; */
  text-align: center;
}
.header .hr {
  /* display: inline-block; */
  width: 1.74rem;
  /* flex: 1; */
  position: absolute;
  right: 0.12rem;
  height: 0.64rem;
  border: 0.005rem solid rgba(255, 255, 255, 0.25);
  border-radius: 0.32rem;
  /* margin-right: 0.1rem; */
  /* flex: 1; */
}
.page .nav {
  width: 7.1rem;
  height: 4rem;
  background-image: linear-gradient(to bottom, #ff6040, #ff8a80);
  padding: 0.2rem 0.2rem 0 0.2rem;
  position: relative;
}
.page .nav .logo {
  width: 7.1rem;
  height: 1.28rem;
  display: flex;
  /* background-color: teal; */
  /* overflow: hidden; */
  position: relative;
}
.page .nav .logo .imgs {
  width: 1.28rem;
  height: 1.28rem;
  border-radius: 50%;
  background-color: pink;
}
.page .nav .logo .uname {
  height: 1.28rem;
  margin-left: 0.2rem;
}
.page .nav .logo .uname .uname1 {
  font-size: 0.36rem;
  color: #fff;
  margin: 0.2rem 0 0.1rem 0;
}
.page .nav .logo .uname .uname2 {
  font-size: 0.24rem;
  color: #fff;
  border: 1px solid #fff;
  border-radius: 1px;
  -webkit-transform: scale(0.9);
  transform: scale(0.9);
  -webkit-transform-origin-x: 0;
}
.page .nav .logo .qd {
  width: 1.52rem;
  height: 0.4rem;
  line-height: 0.4rem;
  text-align: center;
  border-radius: 0.2rem 0 0 0.2rem;
  background-color: #ffd4cc;
  position: absolute;
  right: -0.2rem;
  top: 50%;
  margin-top: -0.2rem;
  color: #ff6243;
  font-size: 0.24rem;
  background: #ffd4cc;
}
.page .nav .hot {
  width: 100%;
  /* background-color: #fff; */
  height: 1.2rem;
}
.page .nav .hot ul {
  width: 100%;
  height: 100%;
  display: flex;
  padding: 0 0.1rem;
  align-items: center;
}
.page .nav .hot ul li {
  flex: 1;
  /* background-color: teal; */
  text-align: center;
  color: #fff;
}
.page .nav .hot ul li > span {
  font-size: 0.36rem;
  -webkit-transform: scale(0.9);
  /* font-weight: 700; */
  transform: scale(0.9);
}
.page .nav .hot ul li > p {
  -webkit-transform: scale(0.9);
  transform: scale(0.9);
  /* -webkit-transform-origin-x: 0; */
  font-size: 0.24rem;
}
.page .nav .order {
  width: 6.7rem;
  height: 1.66rem;
  background-color: #fff;
  border-radius: 0.08rem;
  padding: 0.2rem;
}
.page .nav .order .top {
  width: 100%;
  /* background-color: teal; */
  display: flex;
  justify-content: space-between;
  overflow: hidden;
}
.page .nav .order .top .t1 {
  font-size: 0.32rem;
  color: #333;
  font-weight: 700;
}
.page .nav .order .top .t2 {
  margin-top: 0.1rem;
  color: #ff6040;
  font-size: 0.24rem;
}
.page .nav .order .top .icon2 {
  font-size: 0.2rem;
}
.page .nav .order .btm {
  width: 100%;
  height: 1.44rem;
  /* background-color: pink; */
}
.page .nav .order .btm > ul {
  display: flex;
}
.page .nav .order .btm > ul li {
  flex: 1;
  overflow: hidden;
  /* background-color: gold;; */
  text-align: center;
}
.page .nav .order .btm > ul li img {
  width: 0.64rem;
  height: 0.64rem;
  margin-top: 0.3rem;
  display: block;
}
.page .nav .order .btm > ul li .imgss {
  width: 0.64rem;
  margin: 0 auto;
}
.page .nav .order .btm > ul li p {
  font-size: 0.24rem;
  transform: scale(0.9);
  -webkit-transform: scale(0.9);
  color: #333;
  margin-top: 0.1rem;
}
.page .main {
  width: 7.1rem;
  padding: 0.2rem;
  background-color: #fff;
  overflow: hidden;
  margin-top: 0.72rem;
  /* margin-top:0.2rem; */
}
.page .main ul {
  width: 100%;
  /* padding: 0.2rem; */
}
.page .main ul li {
  display: flex;
  justify-content: space-between;
  /* background-color: gold; */
  height: 0.72rem;
  line-height: 0.72rem;
  padding-left: 0.42rem;
  background-position: 0.04rem center;
  background-repeat: no-repeat;
  background-size: 0.32rem 0.32rem;
}
.page .main ul li p {
  font-size: 0.24rem;
  color: #333;
  font-weight: 700;
}
.page .main ul li .iconfont {
  color: #666;
  font-weight: 400;
}
.page .main ul li:nth-child(1) {
  background-image: url("../../assets/img/icon/user/function/address.png");
}
.page .main ul li:nth-child(2) {
  background-image: url("../../assets/img/icon/user/function/wallet.png");
}
.page .main ul li:nth-child(3) {
  background-image: url("../../assets/img/icon/user/function/QR_code.png");
}
.page .main ul li:nth-child(4) {
  background-image: url("../../assets/img/icon/user/function/partner.png");
}
.page .main ul li:nth-child(5) {
  background-image: url("../../assets/img/icon/user/function/free.png");
}
</style>